<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app1"></div>

  <script src="../js/react.development.js"></script>
  <script src="../js/react-dom.development.js"></script>
  <script src="../js/babel.min.js"></script>
  <script src="../js/prop-types.js"></script>

  <script type="text/babel">
    class Demo extends React.Component {
     
      showData = () => {
        let value = this.refs.input1.value
        alert(value)
      }
      handleBlur = () => {
        let {input2} = this.refs
        alert(input2.value)
      }
      render() {
        return (
          <div>
            <input ref="input1" type="text" placeholder="点击提示数据"/>
            <button  onClick={this.showData}>点我提示数据</button>
            <input ref="input2" type="text" placeholder="失去焦点提示数据" onBlur={this.handleBlur}/>
          </div>
        )
      }
    }

    ReactDOM.render(<Demo />, document.getElementById("app1"))
  </script>
</body>

</html>